#include <stm32f10x.h>
#include "servo.h"
#include "oled.h"
#include "key.h"

uint8_t keyCode;
float angle;
uint8_t i;

int main(void)
{
	OLED_Init();
	Key_Init();
	Servo_Init();
	OLED_ShowString(1,1,"angle:");

	while(1){
		keyCode=Key_GetNum();
		if(keyCode==1)
		angle+=30;
		if(angle>180)
		angle=0;
		OLED_ShowNum(1,7,angle,3);
		ServoSetAngle(angle);
	};
}
